Public replication-summary page (/np/replications)#98
Merged
Conversation
A public page that, given a paper DOI, shows every independent replication of its claims on the nanopub network and the verdict each reached — grouped by the claim tested, with each study's scope/methodology/deviations, conclusion, materials and signed Outcome nanopub. Design: - Client-side, unauthenticated: reads only public nanopub-network data via SPARQL (frontend/src/lib/sparql.ts), so the page works for anyone. The authenticated API stays for programmatic/registered use — no backend or auth change. - Enumerates via the CiTO->DOI verdict-citation method, NOT /np/constellation graph BFS: verified empirically that BFS bleeds into adjacent papers (it pulled a lizard paper into a bumble-bee chain) and misses disconnected replications, while CiTO->DOI returns the correct set (e.g. Soroye 2020 -> its 5 replications). - Retraction/supersession-aware: drops any outcome retracted/invalidated/superseded by a nanopub from the same creator. Run as a scoped guard query (an inline FILTER NOT EXISTS times the endpoint out); best-effort so a guard failure never hides everything. Route: /np/replications?doi=10.1126/science.aax8591
Follow the house SPARQL convention (agent-docs/SPARQL.md): the query now lives in
queries/replications-by-paper.rq with a header comment + ?_doiUri placeholder, its
types are generated (npm run generate:query-types), and replications.ts runs it via
executeBindSparql() with the AbortSignal — no more hand-built query strings in the TS.
Also adopts the admin-graph validity guard idiom from aida-statement-nanopub.rq:
filter not exists { ?inv npx:invalidates ?outcome ; npa:hasValidSignatureForPublicKeyHash ?pubkey }
— npx:invalidates covers retract+supersede and the matching pubkey hash is the
cryptographic signer, so it runs inline in one efficient query (no separate scoped
guard, no endpoint timeout). Verdict relations are selected via VALUES in the query.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A public page —
/np/replications?doi=<DOI>— that shows every independent replication of a paper's claims on the nanopub network and the verdict each reached. Grouped by the claim tested, each replication shows its study's scope / methodology / deviations, conclusion, materials, and a link to the signed Outcome nanopub.Built so the Replication Radar (OpenAIRE hackathon) can link out from "5 replications" to one clean page instead of cramming five links into a card.
Design decisions
frontend/src/lib/sparql.ts). The authenticated API is untouched — programmatic use still requires registration, exactly the intended split./np/constellationBFS. Verified empirically that the constellation graph-BFS bleeds into adjacent papers (it pulled a lizard paper into a bumble-bee chain) and misses disconnected replications, whereas the CiTO→DOI verdict-citation method returns the correct set (Soroye 2020 → its 5 replications).retractscan't suppress someone else's work). Run as a scoped guard query because an inlineFILTER NOT EXISTStimes the endpoint out; best-effort so a guard failure never hides everything.Test
/np/replications?doi=10.1126/science.aax8591→ Soroye 2020's 5 replications (4 confirmed, 1 partial), grouped by claim.Checks
typecheck -w frontend: pass ·build -w frontend: pass · lint: 0 errors (1set-state-in-effectwarning, consistent with 7 existing innp/pages)